package exam;

/**
 * A basic representation of a college undergraduate.
 * 
 * @author Branden Ogata
 *
 */

public class Student
{
  /**
   * The name of this Student.
   * 
   */
  private String name;
  
  /**
   * The major of this Student.
   * 
   */
  private String major;
  
  /**
   * The number of credits that this Student has taken.
   * 
   */
  private int credits;
  
  /**
   * Creates a new Student.
   * 
   * @param name The String containing the name of the new Student.
   * @param major The String containing the major of the new Student.
   * @param credits The int equal to the number of credits this new Student has taken.
   * 
   */
  
  public Student(String name, String major, int credits)
  {
    this.name = name;
    this.major = major;
    this.credits = credits;
  }
  
  /**
   * Gets the name of this Student.
   * 
   * @return this.giver The String containing the name of this Student.
   * 
   */
  
  public String getName()
  {
    return this.name;
  }
  
  /**
   * Gets the major of this Student.
   * 
   * @return this.recipent The String containing the major of this Student.
   * 
   */
  
  public String getMajor()
  {
    return this.major;
  }
  
  /**
   * Gets the number of credits that this Student has taken.
   * 
   * @return this.credits The int equal to the number of credits this Student has obtained.
   * 
   */
  
  public int getCredits()
  {
    return this.credits;
  }
  
  /**
   * Returns a compact description of this Student.
   * 
   * @return A String containing the name, major and credits of this Student.
   * 
   */
  
  @Override
  public String toString()
  {
    return String.format("%s: %s{%d credits}", this.name, this.major, this.credits);
  }
}